package com.edu.neusoft.student.domain;

import lombok.Data;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class Order {

    @NotNull(message = "Order ID cannot be null")
    private Integer orderid;

    @NotNull(message = "Customer ID cannot be null")
    @Min(value = 1, message = "Customer ID must be greater than 0")
    private Integer customerid;

    @NotNull(message = "Order date cannot be null")
    @PastOrPresent(message = "Order date cannot be in the future")
    private Date orderdate;

    @NotNull(message = "Total amount cannot be null")
    @DecimalMin(value = "0.01", inclusive = true, message = "Total amount must be at least 0.01")
    private BigDecimal totalamount;

    @NotNull(message = "Payment status cannot be null")
    @Pattern(regexp = "Pending|Completed|Cancelled", message = "Payment status must be one of: Pending, Completed, Cancelled")
    private String paymentstatus;
}
